#include "updaterdialog.h"

#include <QtGui>

int main(int argc, char *argv[])
{
  QApplication a(argc, argv);

  QString file = QDir::tempPath() + "/keyswitch.upd";

  if (argc > 1)
    file = QString(argv[1]);

  bool install = false;
  if (argc >= 4 && QString(argv[2]) == "/i")
    install = true;


    //QMessageBox::about(0, "", QString("%1 %2 %3").arg(argv[1], argv[2], argv[3]));

    UpdaterDialog w(file, install ? argv[3] : "");
    w.show();


//    if (argc >= 4 && QString(argv[2]) == "/i")
    if (install)
//    {
//      w.setInstallResult(argv[3]);
      QTimer::singleShot(0, &w, SLOT(installFinished()));
//    }
    else
      QTimer::singleShot(0, &w, SLOT(start()));

    return a.exec();
}
